import './assets/main.css'
import { createApp } from 'vue'
import App from './App.vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createRouter, createWebHistory } from 'vue-router'
import routes from './router'

const router = createRouter({ history: createWebHistory(), routes })
const app = createApp(App)
app.use(createPinia())
app.use(ElementPlus)
app.use(router)
const socket = new WebSocket(`${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/api/`)
app.config.globalProperties.$socket = socket
app.mount('#app')
